package lab02.test06;

public class Ladder {

    double top;
    double bottom;
    double high;
    double area;

    public double area() {
        this.area = (top + bottom) * high / 2;

        return area;
    }

    @Override
    public String toString() {
        return "上底：" + top +
               "\n下底：" + bottom +
               "\n高：" + high +
               "\n梯形的面积：" + area();
    }
}
